package net.towee.model.group;

import java.util.List;

import net.towee.model.account.Role;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * This container consists of get/set methods for some role
 * @author c58
 */
public interface RoleContainer extends IsSerializable  {
	/**
	 * Add new role to container
	 * @param role
	 */
	void addRole(Role role);
	
	/**
	 * Delete role from container
	 * @param role
	 */
	void deleteRole(Role role);
	
	/**
	 * Delete role by index
	 * @param index
	 */
	void deleteRole(int index);
	
	/**
	 * @param role
	 * @return role index in container by role object
	 */
	int getRoleIndex(Role role);
	
	/**
	 * @param index
	 * @return some role by index. If role not exists it return null
	 */
	Role getRole(int index);
	
	/**
	 * @return list of all role of container
	 */
	List<Role> getRoleList();
	
	/**
	 * @return default role for new users
	 */
	Role getDefaultRole();
	
	/**
	 * Set new default role
	 * @param role
	 */
	void setDefaultRole(Role role);
}